//
//  LCFRootViewController.m
//  lcf-newproject
//
//  Created by yangyang on 14-11-11.
//  Copyright (c) 2014年 yang. All rights reserved.
//

#import "LCFRootViewController.h"
#import "LCFRootViewController.h"

@interface LCFRootViewController ()
@property (nonatomic,strong)UITableView *tableView;
@end

@implementation LCFRootViewController



-(void)viewDidLoad{
    [super viewDidLoad];
    if (!_ISIOS6) {
        //将statusBar的字体变为白色
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    }
    
}

#pragma mark - UINavigationBar的创建

-(void)setNavigationBarTitle:(NSString *)title{
    UILabel * titleLabel = [LCFUIGlobel createLabelWithTitle:title withFrame:LCFTitleFrame withFontType:nil withFontSize:LCFTitleSize withFontColor:[UIColor whiteColor] isNeedBold:YES];
    //titleLabel.backgroundColor = [UIColor whiteColor];
    self.navigationItem.titleView = titleLabel;
}

-(void)setNavigationLeftBarWithTitle:(NSString *)title
                 withNormalImageName:(NSString *)normalImageName
               withSelectedImageName:(NSString *)selectedImageName
                          withAction:(SEL)action{
    UIImage * image = [UIImage imageNamed:normalImageName];
    UIBarButtonItem * leftItem = [LCFUIGlobel createBarButtonItemWithController:self Title:title withFrame:CGRectMake(0, 0, image.size.width, image.size.height) withNormalImageName:normalImageName withSelectedImageName:selectedImageName withAction:action isLeft:YES];
    self.navigationItem.leftBarButtonItem = leftItem;
    
}

-(void)setNavigationBarRightBarWithView:(UIView *)rightBarButtonView{
    
}

-(void)setNavigationRightBarWithTitle:(NSString *)title
                  withNormalImageName:(NSString *)normalImageName
                withSelectedImageName:(NSString *)selectedImageName
                           withAction:(SEL)action{
    UIImage * image = [UIImage imageNamed:normalImageName];
    UIBarButtonItem * rightItem = [LCFUIGlobel createBarButtonItemWithController:self Title:title withFrame:CGRectMake(0, 0, image.size.width, image.size.height) withNormalImageName:normalImageName withSelectedImageName:selectedImageName withAction:action isLeft:NO];
    self.navigationItem.rightBarButtonItem = rightItem;
}
#pragma mark - tableView
//创建tableView
-(UITableView *)creataTableViewWithFrame:(CGRect)frame
             withTableViewStyle:(UITableViewStyle)style{
    _tableView = [[UITableView alloc]initWithFrame:frame style:style];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    return _tableView;
}

#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 0;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    return nil;
}

#pragma mark - UITableViewDelegate


#pragma mark - 隐藏tabbar
-(void)hideTabBar:(BOOL)hidden{
    AppDelegate *delegate = [[UIApplication sharedApplication]delegate];
    [delegate.CustomTabBarViewController hideTabBar:hidden];
}

-(void)didReceiveMemoryWarning{
    [super didReceiveMemoryWarning];
    self.tableView = nil;
}

@end
